import java.util.Random;
import java.util.Scanner;

public class JavaClass {



    //11.石头剪刀布游戏
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("你出什么:2(石头),1(剪刀),0(布)");
        int n = in.nextInt();                                //n为输入的值
        Random random = new Random();                        //生成随机数
        int m = random.nextInt(3) + 0;                 //左闭右开 [0,3)
        String[] sym = {"布","剪刀","石头"};                   //定义数组

        int x = n - m;
        if (n >= 0 && n <= 2){                               //判断是否输入有效数字
            if (x == 1 || x == -2){                          //判断结果
                System.out.println("你赢啦!");
            } else if (x == 0) {
                System.out.println("平局!");
            } else if (x == -1 || x == 2) {
                System.out.println("你输啦!");
            }
            System.out.println("系统出的是: " + sym[m]);        //给出答案
            System.out.println("你出的是: " + sym[n]);
        }else {
            System.out.println("请输入0,1或2!!!");
        }
    }



    //12.输入一个整数,求各位数字之和

    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int m = in.nextInt();

        int sum = 0;                           //和初始化
        int n =Math.abs(m);                    //处理负整数

        for (   ; n > 0 ;n = n/10 ){
            int a = n % 10;                    //取模求各个数字
            sum += a;                          //累加
        }
        System.out.println(sum);
    }



    //15.鸡兔同笼
    public static void main5(String[] args) {
        System.out.println("请输入腿数: ");
        Scanner in1 = new Scanner(System.in);      //输入腿数
        int a = in1.nextInt();

        System.out.println("请输入头数: ");
        Scanner in2 = new Scanner(System.in);      //输入头数
        int b = in2.nextInt();

        int y =(a - b * 2) / 2;
        int x = b - y;
        System.out.println("鸡有: " + x);
        System.out.println("兔有: " + y);
    }




    //16.打印所有水仙花数

    public static void main6(String[] args) {

        for (int i = 100; i <= 999; i++) {

                int count = 0;
                int tmp = i;
                int sum = 0;

                while ( tmp != 0) {
                    tmp /= 10;
                    count++;
                }
                tmp = i;
                while (tmp != 0 ) {
                    sum += Math.pow(tmp % 10, count);
                    tmp /= 10;
                }
                if (sum == i){
                    System.out.println(sum);
                }
        }
    }




    //输入两个数,输出最小公倍数和最大公约数
    public static void main11(String[] args) {
        Scanner in = new Scanner(System.in);
        num(in.nextInt(), in.nextInt());
        System.out.println();
    }

    public static int num(int x, int y) {

        return 0;
    }


    public static void main(String[] args) {
        int[] n = {1,3,4,3,7,4,7};
        String x = tomystring(n);
        System.out.println(x);
    }





    public static String tomystring(int[] array){
        String ret = "[" ;
        for(int i = 0; i < array.length; i++){
            ret += array[i];
            if (i < array.length-1){
                ret += ",";
            }
        }
        ret += "]";
        return ret;
    }

}
